package com.itheima.exer.test;

public class Box<E> {
    private E name;
    private E age;


   /* public <E> E boxMethod(E name , E age ){
        E a = (name + age);
        return a;
    }*/

    @Override
    public String toString() {
        return "Box{" +
                "name=" + name +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Box<?> box = (Box<?>) o;

        if (name != null ? !name.equals(box.name) : box.name != null) return false;
        return age != null ? age.equals(box.age) : box.age == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + (age != null ? age.hashCode() : 0);
        return result;
    }

    public E getName() {
        return name;
    }

    public void setName(E name) {
        this.name = name;
    }

    public E getAge() {
        return age;
    }

    public void setAge(E age) {
        this.age = age;
    }

    public Box() {
    }

    public Box(E name, E age) {
        this.name = name;
        this.age = age;
    }
}
